
/*1.定义狗类
属性：年龄，颜色
行为：eat（String something）（something表示吃的东西）看家lookHome方法（无参数）*/
package polymorphismdemo4_practice;

public class dog extends animal {
    public dog() {

    }

    public dog(int age, String color) {
        super(age, color);
    }

    // 行为
    @Override
    public void eat(String something) {
        System.out.println(getAge() + "岁的" + getColor() + "颜色的狗狠狠地保住" + something + "猛吃");
    }

    public void lookHome() {
        System.out.println("狗在看家");
    }
}
